var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var Item_Icon_UIBindings = require("AA_Item_Icon_UIBindings");
var ResKeeper = require("AA_ResKeeper");
var BundleConfig = require("AA_BundleConfig");
var Excel = require("AA_Excel");
var CommonUtils = require("AA_CommonUtils");
var Const_Hall = require("AA_Const_Hall");
var HallGlobalVariable = require("AA_HallGlobalVariable");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;

var _def_Item_Icon = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.auto_ui = null;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.init = function (e, t) {
    var o = this;
    this.auto_ui.txt_countLabel.string = "x" + t;
    var n = 1;
    switch (e) {
      case HallGlobalVariable.default.goldId:
      case HallGlobalVariable.default.diamondId:
      case HallGlobalVariable.default.powerId:
        var i = "goldIcon";
        if (e == HallGlobalVariable.default.diamondId) {
          i = "diamondIcon";
        } else {
          e == HallGlobalVariable.default.powerId && (i = "powerIcon");
        }
        this._loadRes(BundleConfig.BundleNames.Common, "common/" + "res/ui/tu/" + i, cc.SpriteFrame).then(function (e) {
          o.auto_ui.sp_icon.spriteFrame = e;
          CommonUtils.default.LimitSpriteMaxSize(o.auto_ui.sp_icon, Const_Hall.equipIconSize);
        });
        this._loadRes(BundleConfig.BundleNames.Common, "common/" + "res/quality/quality_m_1", cc.SpriteFrame).then(function (e) {
          o.auto_ui.sp_quality.spriteFrame = e;
        });
        break;
      default:
        n = Excel.Excel.shuiguo(e).quality;
        this._loadRes(BundleConfig.BundleNames.Common, "common/" + "res/player/player" + (e - 1e3) + "_1", cc.SpriteFrame).then(function (e) {
          o.auto_ui.sp_icon.spriteFrame = e;
          CommonUtils.default.LimitSpriteMaxSize(o.auto_ui.sp_icon, Const_Hall.equipIconSize);
        });
        this._loadRes(BundleConfig.BundleNames.Common, "common/" + "res/quality/quality_" + n, cc.SpriteFrame).then(function (e) {
          o.auto_ui.sp_quality.spriteFrame = e;
        });
    }
  };
  __decorate([_property(Item_Icon_UIBindings.default)], _creator.prototype, "auto_ui", undefined);
  return __decorate([_ccclass], _creator);
}(ResKeeper.default);
exports.default = _def_Item_Icon;